package lowijs.XfireClient.packet;

import android.content.SharedPreferences;

public class VersionPacket extends Packet {
	public static final String PREF_VERSION = "xfire.version";

	public static final int TARGET_VERSION = 123;

	private final byte[] p_version_1 = new byte[] {
			0x03, 0, 0x01, 0x07,
			0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, // version
			0x02
	};
	
	public VersionPacket(SharedPreferences preferences) {
		putBytes(p_version_1);
		putInt(getVersion(preferences));
	}

	public static int getVersion(SharedPreferences preferences) {
		return preferences.getInt(PREF_VERSION, TARGET_VERSION);
	}
}
